package cc.zy.base.hr.mapper;

import cc.zy.base.hr.entity.Lecturer;
import cc.zy.base.hr.entity.OutsideTeacher;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
 * @author 郝秀峰
 * @time 2022/03/08 19:27:30
 */
public interface OutsideTeacherMapper extends BaseMapper<OutsideTeacher> {

    /**
     * 查找外部讲师详细信息
     *
     * @param page    分页对象
     * @param outsideTeacher 外部讲师对象，用于传递查询条件
     * @return Ipage
     */
    <T> IPage<OutsideTeacher> findOutsideTeacherDetailPage(Page<T> page, @Param("outsideTeacher") OutsideTeacher outsideTeacher);

    long countOutsideTeacherDetail(@Param("outsideTeacher") OutsideTeacher outsideTeacher);

    /**
     * 通过ID查找外部讲师
     *
     * @return 外部讲师
     */
    OutsideTeacher getById(Integer outsideTeacherId);

    /**
     * 查找外部讲师详细信息
     *
     * @param outsideTeacher 外部讲师对象，用于传递查询条件
     * @return List<OutsideTeacher>
     */
    List<OutsideTeacher> findOutsideTeacherDetail(@Param("outsideTeacher") OutsideTeacher outsideTeacher);

    /**
     * 查询不带分页
     */
    List<OutsideTeacher> findOutsideTeacherListNotPage(@Param("outsideTeacher") OutsideTeacher outsideTeacher);


    /**
     * 判断是否重复
     * @param  realName 真实名字
     * @return
     */
    String isRepetitive(@Param("realName") String realName,@Param("phone") String phone);

    /**
     * 修改状态
     *
     * @return
     */
    void updateOutsideTeacherStatus(Integer outsideTeacherId);


    /**
     * @Author: PW
     * @Description: 分页/条件查询
     * @DateTime: 2022/3/8 22:00
     * @Params: [page, outsideTeacher]
     * @Return com.baomidou.mybatisplus.core.metadata.IPage<cc.zy.base.hr.entity.StaffLabel>
     */
    <T> IPage<Lecturer> listOutsideTeacher(Page<T> page, @Param("lecturer") Lecturer lecturer);

    /**
     * @Author: PW
     * @Description: 查询总条数
     * @DateTime: 2022/3/8 22:09
     * @Params: [outsideTeacher]
     * @Return long
     */
    long countOutsideTeacherForSelectDetail(@Param("lecturer") Lecturer lecturer);

}